<?php

namespace App\Events;

use App\Models\Config;
use App\Models\Reserves;
use App\Models\Visitor;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;

class VisitorReservesEvent
{
    use Dispatchable, InteractsWithSockets, SerializesModels;

    public Visitor  $visitor;
    public Config   $config;
    public Reserves $reserves;

    /**
     * @param Config $config
     * @param Reserves $reserves
     * @param Visitor $visitor
     */
    public function __construct(Config $config,Reserves $reserves,Visitor $visitor)
    {
        $this->visitor  = $visitor;
        $this->config   = $config;
        $this->reserves = $reserves;
    }


    /**
     * Get the channels the event should broadcast on.
     *
     * @return \Illuminate\Broadcasting\Channel|array
     */
    public function broadcastOn()
    {
        return new PrivateChannel('channel-name');
    }
}
